Update INI File 

The Update INI File section replaces, deletes, or adds complete entries in the INI file. The section name, update-ini-section-name, must appear in the UpdateInis item in the Install3AN5O2 section of the INF file.

[update-ini-section-name]

ini-file,ini-section,[old-ini-entry],[new-ini-entry],[flags]

.

.

.

 

ini-file

The INI file containing the entry to change.

ini-section

Name of the section containing the entry to change.

old-ini-entry

Optional. Usually in the form key=value.

new-ini-entry

Optional. Usually in the form key=value. Either the key or value may specify replaceable strings. For example, either the key or value specified in the new-ini-entry parameter may be %String1%, where the string that replaces %String1% is defined in the Strings22R4H3P section of the INF file.

flags

Optional action flags. The flags parameter can be one of the following values:

Value

Meaning

0

Default. If old-ini-entry key is present in an INI file entry, that entry is replaced with new-ini-entry. Only the keys of the old-ini-entry parameter and the INF file entry must match; the value of each entry is ignored.

To add new-ini-entry to the INI file unconditionally, set old-ini-entry to NULL. To delete old-ini-entry from the INI file unconditionally, set new-ini-entry to NULL.

1

If both key and value of old-ini-entry exist in an INI file entry, that entry is replaced with new-ini-entry. The old-ini-entry parameter and the INF file entry must match on both key and value for the replacement to be made (this is in contrast to using an action flag value of 0, where only the keys must match for the replacement to be made).

2

If the key in the old-ini-entry parameter does not exist in the INI file, no operation is performed on the INI file.

If the key in the old-ini-entry parameter exists in an INI file entry and the key in the new-ini-entry parameter exists in an INI file entry, the INI file entry that matches the key in the new-ini-entry parameter is deleted, and the key of the INI file entry that matches the old-ini-entry parameter is replaced with the key in the new-ini-entry parameter.

If the key in the old-ini-entry parameter exists in an INI file entry and the key in the new-ini-entry parameter does not exist in an INI file entry, an entry made up of the key in the new-ini-entry parameter and the old value is added to the INI file.

The match of the old-ini-entry parameter and an INI file entry is based on key alone, not key and value.

3

Same as the flags parameter value of 2 described preceding, except the match of the old-ini-entry parameter and an entry in the INF file is based on matching both key and value, not just the key.

 

You can use the wild card character (*) in specifying the key and value and they will be interpreted correctly.

 

The ini-filename can be a string or a strings key. A strings key has the form %strkey% where strkey is defined in the Strings22R4H3P section in the INF file. The name must be a valid filename.

The ini-filename should include the name of the directory containing the file, but the directory name should be given as a directory identifier rather than an actual name. The installer replaces a directory identifier with an actual name during installation.

A directory identifier has the form %dirid% where dirid is one of the predefined identifiers or an identifier set by SetupSetDirectoryId1PNAZ4P. When using a directory identifier, you should use the backslash in a path. For example, you can use %11%\card.ini to reference CARD.INI in the System32 directory.

The following examples illustrate individual items in an Update INI File section:

%11%\sample.ini, Section1,, Value1=2             ; adds new entry

%11%\sample.ini, Section2, Value3=*,             ; deletes old entry

%11%\sample.ini, Section4, Value5=1, Value5=4    ; replaces old entry